﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebDesign.maneger
{
    public partial class term : System.Web.UI.Page
    {
        SqlClass scl = new SqlClass();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                scl.BindCombobox("select * from Termtbl ", "TermId", "TermName", ddTerm);
        }

        protected void Btnterm_Click(object sender, EventArgs e)
        {

            scl.BindGridView("select ApplicantName,ApplicantFamily,ApplicantMobile,ApplicantPhone,EducationLevel,TermName,EnrollmentDate from Enrollmenttbl,Applicanttbl,Termtbl where Termtbl.TermId=Enrollmenttbl.TermId and Enrollmenttbl.ApplicantId=Applicanttbl.ApplicantId and TermName=N'"+ddTerm.SelectedItem.Text+"'",gvTerm);
        }

        protected void btnDate_Click(object sender, EventArgs e)
        {
            scl.BindGridView("select ApplicantName,ApplicantFamily,ApplicantMobile,ApplicantPhone,EducationLevel,TermName,EnrollmentDate from Enrollmenttbl,Applicanttbl,Termtbl where Termtbl.TermId=Enrollmenttbl.TermId and Enrollmenttbl.ApplicantId=Applicanttbl.ApplicantId and EnrollmentDate='" +txtDate.Text + "'", gvTerm);
        }
    }
}